package com.itheima.set;

import java.util.Comparator;
import java.util.TreeSet;

public class Demo05 {

    public static void main(String[] args) {


        TreeSet<String> set = new TreeSet<>(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.length()-o2.length()==0?o1.compareTo(o2):o1.length()-o2.length();
            }
        });
        set.add("c");
        set.add("bd");
        set.add("abc");
        set.add("bde");
        System.out.println(set);



    }
}
